from __future__ import unicode_literals
import requests
from bs4 import BeautifulSoup
import time
import json

ct=0
with open('povd.txt','r',encoding='utf-8') as f:
    for url in f:
        try:
            r=requests.get(url,timeout=5)
            content=r.content
            soup=BeautifulSoup(content,'html')

            mp4url=soup.find('source')['src']+'\n'

            with open('povdurl.txt','a',encoding='utf-8') as ff:
                ff.write(mp4url)
        except Exception as e:
            print(e)
        finally:
            time.sleep(2)
            ct=ct+1
            print(str(ct))